package com.techsoul.module.tms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.module.order.pojo.entity.PurchaseOrder;
import com.techsoul.module.order.pojo.entity.PurchaseOrderItem;
import com.techsoul.module.pms.pojo.entity.TbWmsMaterialDeliveryLine;
import com.techsoul.module.pms.pojo.param.TbWmsMaterialDeliverySaveParam;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryLineVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryVo;
import com.techsoul.module.tms.pojo.entity.TFoFreightOrder;
import com.techsoul.module.tms.pojo.entity.TFoFreightOrderItem;
import com.techsoul.module.tms.pojo.entity.TFoTransitRoute;
import com.techsoul.module.tms.pojo.param.TFoFreightOrderSaveParam;
import com.techsoul.module.tms.pojo.param.TFoFreightOrderSearchParam;
import com.techsoul.module.tms.pojo.vo.TFeeRoutePriceNewVo;
import com.techsoul.module.tms.pojo.vo.TFoFreightOrderItemVo;
import com.techsoul.module.tms.pojo.vo.TFoFreightOrderVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 运单主 Service接口
 * 
 * @author liuen
 * @date 2023-05-29
 */
public interface ITFoFreightOrderService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(TFoFreightOrderSaveParam params);
    Double getMileFromTwoLocations(TFoTransitRoute transitRoute);
    String generateFreightOrderFromDelivery
            (TFoFreightOrderSaveParam params , TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo,
             TbWmsMaterialDeliveryVo tbWmsMaterialDeliveryVo, PurchaseOrder order, PurchaseOrderItem item) ;
    String generateFreightOrderFromDelivery
            (TFoFreightOrderSaveParam params , TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo,
             TbWmsMaterialDeliveryVo tbWmsMaterialDeliveryVo, TFoFreightOrder order, TFoFreightOrderItem item) ;
    String generateFreightOrderFromDelivery
            (TbWmsMaterialDeliverySaveParam params , List<TbWmsMaterialDeliveryLine> tbWmsMaterialDeliveryLines,
             TFoFreightOrder order, List<TFoFreightOrderItem> items) ;


    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);
    List<TFeeRoutePriceNewVo> findFtlRoutepriceUseTariff(TFoFreightOrder tFoFreightOrderVo);
    List<TFeeRoutePriceNewVo> findFtlRoutepriceUseTariff(PurchaseOrder tFoFreightOrder);
    List<TFeeRoutePriceNewVo> findFtlPerMileRoutepriceUseTariff(PurchaseOrder tFoFreightOrder);
    List<TFeeRoutePriceNewVo> findRoutepriceUseTariff(PurchaseOrderItem freightOrderItem);
    List<TFeeRoutePriceNewVo> findFtlPerMileRoutepriceUseTariff(TFoFreightOrder tFoFreightOrderVo);
    List<TFeeRoutePriceNewVo> findPerMileRoutepriceUseTariff(TFoFreightOrderItem tFoFreightOrderItemVo);
    List<TFeeRoutePriceNewVo> findRoutepriceUseTariff(TFoFreightOrderItem tFoFreightOrderItemVo);
    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(TFoFreightOrderSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    TFoFreightOrderVo findById(String id);
    TFoFreightOrderVo getOrderDetail(String orderId);
    /**
     * 列表
     * @param params
     * @return
     */
    List<TFoFreightOrderVo> findAll(TFoFreightOrderSearchParam params);

    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<TFoFreightOrderVo> findAll(TFoFreightOrderSearchParam params, Integer current, Integer pageSize);

}
